version: '3'
services:
  elastic:
    build: .
    container_name: centos-elastic
    environment:
      ES_JAVA_OPTS: "-Xmx512m -Xms512m"
      ELASTIC_USERNAME: "elastic"
      ELASTIC_PASSWORD: "test"
      discovery.type: single-node
    volumes:
      - ./configs/elasticsearch/elasticsearch.yml:/etc/elasticsearch/elasticsearch.yml:ro
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - elk

  kibana:
    image: kibana:5
    depends_on:
      - elastic
    volumes:
      - ./configs/kibana/config.yml:/usr/share/kibana/config/kibana.yml:ro
    networks:
      - elk
    ports:
      - "5601:5601"

networks:
  elk:
    driver: bridge
